<?php

namespace App\Services;

use Illuminate\Support\Facades\Cache;

class Banner
{
    public static function getBannerList()
    {
        return Cache::remember('banner-list', 8 * 60 * 60, function () {
            return \App\Models\Banner::query()->with('attachments')->orderBy('sort_id')->get()->toArray();
        });
    }

    public static function freshBannerListCache()
    {
        Cache::forget('banner-list');
    }
}
